<?php
namespace Admin\Controller;
use Common\Controller\CommonController;
class MessageController extends CommonController {
	protected $tableName = 'Message';
    public function index(){

    }
	//显示全部留言列表
    public function lst(){

        $model = D('Message'); 
        $data = $model->select();
         #print_r($data);
        $this->assign('message', $data);
       // $this->display();
    }
	//显示留言详情
    public function lst_main($id=''){

 		$id = trim(I('id'));
     	$model = D('Message'); 
     	$data = $model->find($id);
		if(!$data){
			echo'数据不存在或已被删除';
			exit;
		}
        #print_r($data);
        $this->assign('message', $data);
       // $this->display();
    }

    //添加留言-显示表单
     public function del($id=''){
     		$id = trim(I('id'));
	     	$model = D('Message'); 

	        if($model->delete($id)){
	        	echo "删除成功";
	        }else{
	        	echo "删除失败";
	        }
    }

}